import request from '@/utils/request';

// 开始工单流程
export function netStartWorkFlow(data) {
  return request({
    url: '/workflow/task/startWorkFlow',
    method: 'post',
    data,
    isJson: true,
  });
}

// 工单提交
export const netCompleteTask = (data) => {
  return request({
    url: '/workflow/task/completeTask',
    method: 'post',
    data: data,
    isJson: true,
  });
};

// 出门证申请
export function addPassPermit(data) {
  return request({
    url: '/workflow/passPermit',
    method: 'post',
    data,
    isJson: true,
  });
}

// 出门证的明细列表
export function getDetailList(data) {
  return request({
    url: '/workflow/passPermitDetail/list',
    method: 'get',
    data,
    isJson: true,
  });
}

// 明细列表每项提交
export function netPassPermitDetail(data) {
  return request({
    url: '/workflow/passPermitDetail',
    method: 'post',
    data,
    isJson: true,
  });
}

// 报事报修
export function addBaoshiBaoxiu(data) {
  return request({
    url: '/workflow/baoshiBaoxiu',
    method: 'post',
    data,
    isJson: true,
  });
}

// 设备维修
export function addFacilityRepair(data) {
  return request({
    url: '/workflow/facilityRepair',
    method: 'post',
    data,
    isJson: true,
  });
}

// 零星报修
export function addRepairService(data) {
  return request({
    url: '/workflow/repairService',
    method: 'post',
    data,
    isJson: true,
  });
}

// 访客邀约、访客预约
export function addVisitorInvite(data) {
  return request({
    url: '/workflow/visitorInvite',
    method: 'post',
    data,
    isJson: true,
  });
}

// 访客邀约、访客预约
export function getVisitorInviteDetail(data) {
  return request({
    url: '/workflow/visitorInvite/' + data,
    method: 'get',
    isJson: true,
  });
}

// H5访客预约
export function addH5VisitorInvite(data) {
  return request({
    url: '/workflow/visitorInvite/addByScan',
    method: 'post',
    data,
    isJson: true,
  });
}

// 告警上报
export function addSecurity(data) {
  return request({
    url: '/workflow/security',
    method: 'post',
    data,
    isJson: true,
  });
}

// 设备设施
export function getFacilityListall() {
  return request({
    url: '/park/facility/listAll',
    method: 'get',
    isJson: true,
  });
}

// 设备设施
export function getFacilityInfoByQrcode(qrcode) {
  return request({
    url: '/park/qrcode/getFacilityInfoByQrcode',
    method: 'get',
    data: { qrcode },
    isJson: true,
  });
}

//  职工入住申请
export const addEmployeeApartment = (data) => {
  return request({
    url: '/workflow/employeeApartment',
    method: 'post',
    data: data,
    isJson: true,
  });
};

// 新增外来人员入住公寓申请
export const addExterPersonApartment = (data) => {
  return request({
    url: '/workflow/exterPersonApartment',
    method: 'post',
    data: data,
    isJson: true,
  });
};
